package com.sam.im.heiqun.uis.adapters.holder;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.sam.im.heiqun.R;
import com.sam.im.heiqun.uis.adapters.SearchFriendAdpter;

/**
 * Created by Joe on 2016/12/20.
 */

public class SearchFriendHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
    public final View mView;
    public final ImageView head_image;
    public final TextView nick;
    public final TextView agree;
    public final TextView sign;
    private SearchFriendAdpter.SearchFriendListClickListener mSearchFriendListClickListener;

    public SearchFriendHolder(View view, SearchFriendAdpter.SearchFriendListClickListener searchFriendListClickListener) {
        super(view);
        mView = view;
        this.mSearchFriendListClickListener =searchFriendListClickListener;
        head_image = (ImageView) view.findViewById(R.id.image);
        nick = (TextView) view.findViewById(R.id.nick);
        agree = (TextView) view.findViewById(R.id.agree);
        sign = (TextView) view.findViewById(R.id.sign);

        mView.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if (mSearchFriendListClickListener!=null)
        {
            mSearchFriendListClickListener.onSearchItemClick(v,getAdapterPosition());
        }
    }
}